package com.crl.map.core
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.utils.Dictionary;
	
	public class DepthSwaperContainer extends Sprite
	{
		private var depths:Dictionary;
		public function DepthSwaperContainer()
		{
			super();
			
			depths=new Dictionary(true);
		}
		
		
		public function getDepth(child:DisplayObject):int{
			return -1;
		}
		
		override public function removeChild(child:DisplayObject):DisplayObject{
			super.removeChild(child);
			depths[child]=null;
			delete depths[child];
			return child;
		}
		
		override public function removeChildAt(index:int):DisplayObject{
			var child:DisplayObject=super.removeChildAt(index);
			
			depths[child]=null;
			delete depths[child];
			return child;
		}
		
		override public function addChild(child:DisplayObject):DisplayObject{
			return super.addChild(child);
		}
		
		override public function addChildAt(child:DisplayObject, index:int):DisplayObject{
			return super.addChildAt(child,index);
		}
	}
}